﻿using System;
using System.Collections.Generic;
using System.Text;

namespace BusinessLayer.Functions
{
    public class Strings
    {
        public static string Mid(string deger, int baslangic, int uzunluk)
        {
            string sonuc = "";
            if (deger.Length > baslangic + uzunluk - 1)
            {
                sonuc = deger.Substring(baslangic - 1, uzunluk);
            }
            else
            {
                sonuc = deger.Substring(baslangic - 1);
            }
            return sonuc;
        }
        public static string Mid(string deger, int baslangic)
        {
            return deger.Substring(baslangic);
        }
        public static String Space(int adet)
        {
            string retdeger = "";
            for (int i = 0; i < adet; i++)
            {
                retdeger += " ";
            }
            return retdeger;
        }
        public static int Len(string deger)
        {
            return deger.Length;
        }
        public static string Format(decimal sayi, string format)
        {
            return sayi.ToString(format);
        }
        public static string Format(int sayi, string format)
        {
            return sayi.ToString(format);
        }
    }
}
